package org.meb.speedway.model.common;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

import lombok.Getter;
import lombok.Setter;

@Entity
@Table(name = "t_int_event")
@Getter
@Setter
public class IntEvent implements Serializable {

	public enum Status {
		REGISTERED, UPDATED, PROCESSED
	}

	private static final long serialVersionUID = -5741287702851130822L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@Version
	private Long version;

	@Embedded
	private Fingerprint fingerprint = new Fingerprint();

	@Column(length = 20, nullable = false)
	@Enumerated(EnumType.STRING)
	private Status status;

	@Column(length = 200, nullable = false)
	private String eventUri;

	@Column(length = 100)
	private String eventName;

	@Column(length = 100)
	private String eventGroup;

	@Column(length = 500)
	private String eventComment;

	@Temporal(TemporalType.TIMESTAMP)
	private Date eventDate;
}
